package cn.liujianbo.example.base.annotation;

import java.lang.reflect.Method;

/**
 * @author 刘建波
 * @date 2021-01-15 15:33
 */
public class Demo {
    @MyAnnotation("hello2")
    public static void main(String[] args) throws NoSuchMethodException {
        Class<Demo> demoClass = Demo.class;
        System.out.println(demoClass.isAnnotation());
        Method method = demoClass.getMethod("main", String[].class);
        MyAnnotation annotation = method.getAnnotation(MyAnnotation.class);
        System.out.println("annotation = " + annotation.value());
    }
}
